# Contributor: Andy Postnikov <apostnikov@gmail.com>
# Maintainer: Andy Postnikov <apostnikov@gmail.com>

pkgname=php81-pecl-smbclient
_extname=smbclient
pkgver=1.1.1
pkgrel=1
pkgdesc="PHP 8.1 extension that uses Samba's libsmbclient library to provide Samba related functions and 'smb' streams to PHP programs."
url="https://pecl.php.net/package/smbclient"
arch="all"
license="BSD-2-Clause"
_phpv=81
_php=php$_phpv
depends="$_php-common"
makedepends="$_php-dev samba-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir"/$_extname-$pkgver

build() {
	phpize$_phpv
	./configure --prefix=/usr --with-php-config=php-config$_phpv
	make
}

check() {
	# Test suite require smb to run.
	$_php -d extension=modules/$_extname.so --ri smbclient
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/$_php/conf.d
	install -d $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="
17df088cacb80c378dec38fd6c6b8e83e1f6d8787e96e5eccac72792f8125cadda205568466fccd21900d1854bdaf3f042992d44e1c5ef458ade61aeec483513  php-pecl-smbclient-1.1.1.tgz
"
